package com.example.damaimaven.web;

import com.example.damaimaven.mapper.DemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//控制器
@RestController
public class TestAction {
    int b = 250;
    //地址映射
    @RequestMapping("hello")
    public String hello(String name){
        return "Hello " + name;
    }

    int a =100;

    @Autowired // Spring 自动注入
    DemoMapper demoMapper;

    @RequestMapping("users")
    public List<?> queryAllUser(){
        return demoMapper.selectAllUser();

    }
}
